package com.zwb.crasher;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.Application;
import android.content.DialogInterface;
import android.widget.Toast;

import com.githang.androidcrash.AndroidCrash;
import com.zwb.crasher.reporter.mail.CrashEmailReporter;

/**
 * Created by jasonchou on 15/7/13.
 */
public class DemoApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

        initCrasher();
    }

    private void initCrasher() {

//        com.githang.androidcrash.reporter.mailreporter.CrashEmailReporter reporter = new com.githang.androidcrash.reporter.mailreporter.CrashEmailReporter(this);
//        reporter.setReceiver("wenbin@utodo.cn");
//        reporter.setSender("android_error@utodo.cn");
//        reporter.setSendPassword("5114671a");
//        reporter.setSMTPHost("smtp.exmail.qq.com");
//        reporter.setPort("465");
//        AndroidCrash.getInstance().setCrashReporter(reporter).init(this);

        new WbCrasher.Builder(this).setLogFile("zwb").setReporter(
                new CrashEmailReporter(this)
                        .setReceiver("wenbin@utodo.cn")
                        .setSender("android_error@utodo.cn")
                        .setSendPassword("5114671a")
                        .setSMTPHost("smtp.exmail.qq.com")
                        .setPort("465")).build().share();
    }
}
